Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / network / src / androidMain / kotlin / org / meshtastic / core / network / repository / AndroidSerialDevicePresence.kt

Displaying Raw • Download

core/network/src/androidMain/kotlin/org/meshtastic/core/network/repository/AndroidSerialDevicePresence.kt b4bedd92fcc8d65daff79200d71f6ebc3d8f0cfa (b4bedd92) Text, 1.76 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.network.repository

Tff7b72import T7ee787androidx.lifecycle.Lifecycle
Tff7b72import T7ee787androidx.lifecycle.coroutineScope
Tff7b72import T7ee787kotlinx.coroutines.flow.SharingStarted
Tff7b72import T7ee787kotlinx.coroutines.flow.map
Tff7b72import T7ee787kotlinx.coroutines.flow.stateIn
Tff7b72import T7ee787org.koin.core.annotation.Named
Tff7b72import T7ee787org.koin.core.annotation.Single
Tff7b72import T7ee787org.meshtastic.core.common.di.PROCESS_LIFECYCLE

T8b949e/**
* Android implementation of [SerialDevicePresence] backed by [UsbRepository.serialDevices].
*
* Derives a [Set] of device keys (the map's keys) from the underlying [UsbRepository] flow so consumers do not depend
* on the Android-only [android.hardware.usb.UsbDevice] / [com.hoho.android.usbserial.driver.UsbSerialDriver] types.
*/
Tf0883e@Single
Tff7b72class T56d364AndroidSerialDevicePresenceTb4b4b4(Te6edf3usbRepositoryTb4b4b4: Te6edf3UsbRepositoryTb4b4b4, Tf0883e@NamedTb4b4b4(Te6edf3PROCESS_LIFECYCLETb4b4b4) Te6edf3processLifecycleTb4b4b4: Te6edf3LifecycleTb4b4b4) Tb4b4b4:
Te6edf3SerialDevicePresence Tb4b4b4{
Tff7b72override Tff7b72val Te6edf3deviceKeys Tff7b72=
Te6edf3usbRepositoryTb4b4b4.Te6edf3serialDevices
Tb4b4b4.Te6edf3map Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3keysTb4b4b4.Te6edf3toSetTb4b4b4(Tb4b4b4) Tb4b4b4}
Tb4b4b4.Te6edf3stateInTb4b4b4(Te6edf3processLifecycleTb4b4b4.Te6edf3coroutineScopeTb4b4b4, Te6edf3SharingStartedTb4b4b4.Te6edf3EagerlyTb4b4b4, Te6edf3emptySetTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s